package braden.cis.uab.edu;

import braden.cis.uab.edu.automaton.AutomatonDrawingActivity;
import braden.cis.uab.edu.grammar.CFGEditorActivity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainMenu extends Activity {

	private Button finiteAutomatonButton;
	private Button contextFreeGrammarButton;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main_menu);

		finiteAutomatonButton = (Button) findViewById(R.id.finite_automaton_button);
		finiteAutomatonButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(v.getContext(), AutomatonDrawingActivity.class);
				startActivity(intent);
			}
		});
		
		contextFreeGrammarButton = (Button) findViewById(R.id.context_free_grammar_button);
		contextFreeGrammarButton.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(v.getContext(), CFGEditorActivity.class);
				startActivity(intent);
			}
		});
	}
}